package com.future.hedongjun.home.bean.response;

import com.future.baselib.entity.BaseResponse;
import com.future.hedongjun.home.bean.CategoryBean;
import com.future.hedongjun.home.bean.ClassIntroduceBean;
import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Date：2018/12/6 10:40
 * author: liu.p.f
 * Describe：
 */
public class ClassIntroduceResponse extends BaseResponse {

    public List<ClassIntroduceBean> data;

    @Override
    public void parseInfo(String content) throws JSONException {
        JSONObject array = new JSONObject(content);
        data = new ArrayList<>();
        // for (int i = 0; i < array.length(); i++) {
        //  JSONObject object = array.optJSONObject(content);
        ClassIntroduceBean bean = new ClassIntroduceBean();
        bean.id=array.optString("id");
        bean.name = array.optString("name");
        bean.price = array.optString("price");
        bean.introduction = array.optString("introduction");
        bean.imgUrl = array.optString("logo_img");
        bean.buy_status = array.optString("buy_status");
        bean.buy_status = array.optString("buy_status");
        bean.tutor_url = array.optString("tutor_url");
        data.add(bean);
        //  }
    }
}
